package com.dragon.design.pattern.creational.singleton;

/**
 * 懒汉式单例设计模式
 *
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/5/15 18:21
 */
public class LazySingleton {

    private static LazySingleton lazySingleton = null;

    private LazySingleton() {
    }

    public synchronized static LazySingleton getInstance() {
        if (lazySingleton == null) {
            lazySingleton = new LazySingleton();
        }

        return lazySingleton;
    }
}
